const routes = [
    {
        path: '/',
        name: 'Base',
        component: () => import('../layouts/BaseLayout.vue'),
        redirect: 'index',
        children: [
            {
                path: 'index',
                name: 'Home',
                component: () => import('../views/base/QuestionView.vue'),
                meta: {
                    title: "主页",
                }
            },
            {
                path: 'pk',
                name: 'Pk',
                component: () => import('../views/base/PkView.vue'),
                meta: {
                    title: "对战",
                    login: true
                }
            },
            {
                path: 'rank',
                name: 'Rank',
                component: () => import('../views/base/RankView.vue'),
                meta: {
                    title: "天梯",
                    login: true
                }
            },
            {
                path: 'room',
                name: 'Room',
                component: () => import('../views/base/RoomView.vue'),
                meta: {
                    title: "房间",
                }
            },
            {
                path: "record",
                name: "SubmitRecord",
                component: () => import('../views/base/SubmitRecordView.vue'),
                meta: {
                    title: "提交记录"
                }
            }
        ]
    },
    {
        path: '/user',
        name: 'User',
        component: () => import('../layouts/UserLayout.vue'),
        children: [
            {
                path: "login",
                name: 'Login',
                component: () => import('../views/user/LoginView.vue'),
            },
            {
                path: "register",
                name: 'Register',
                component: () => import('../views/user/RegisterView.vue'),
            },
            {
                path: "userinfo",
                name: 'UserInfo',
                component: () => import('../views/user/UserInfoView.vue'),
                meta: {
                    login: true
                }
            }
        ]
    },
    {
        path: "/exception",
        name: "Exception",
        children: [
            {
                path: "403",
                name: "403",
                component: () => import("../views/exception/403View.vue"),
                meta: {
                    title: "403",
                    hide: "true",
                },
            },
        ],
    },
    {
        path: "/question",
        name: "Question",
        component: () => import('../layouts/BaseLayout.vue'),
        children: [
            {
                path: "do/:id",
                name: "QuestionDo",
                component: () => import('../views/problem/DoQuestionView.vue'),
                meta: {
                    login: true
                }
            },
            {
                path: "room",
                name: "QuestionRoom",
                component: () => import('../views/room/RoomQuestionView.vue'),
                meta: {
                    login: true
                }
            },
        ]
    },
    {
        path: "/pk/question",
        name: "PkQuestion",
        component: () => import('../views/problem/PkQuestionView.vue'),
        meta: {
            login: true
        }
    }
]


export default routes;
